Gestalt
equivalent on the Windows side which will tell you if QD3D
is present?
Gestalt
on Windows. It's not really necessary because the
entire system is just based on shared libraries (DLLs). The simplest way to check for the presence of QD3D is to try and load the QD3D
library.
#if defined (DEBUG) hinst = LoadLibrary( "QD3D_D.DLL" ); #else hinst = LoadLibrary( "QD3D.DLL" ); #endif if ( hinst != NULL ) { Q3GetVersion( &major, &minor ); // Use it... } else { // QuickDraw 3D not present // handle that... }
Additionally the QD3D DLLs all have version resources which can be queried using the Win32 version control API without loading the library.
The QD3D installer registers several keys in the registry which could also be used to determine if QD3D was installed. Note: Apple requires that Independent Software Vendors install QD3D using the QD3D installer or its equivalent. Just copying the DLLs is not sufficient. These include HKLM\SOFTWARE\Apple Computer Inc\QuickDraw 3D\...LoadLibrary
and GetProcAddress
routines
or related functions.
However, keep in mind that one of the most common reasons that Mac OS applications do not link
against QD3D is because they wish to keep their memory image small. This is really
not an issue on Windows due to the way virtual memory and the loader work in that environment.
On Windows, a more accurate metric of runtime memory usage is working set.